
# (1) 定义一个Entry类
class Entry:
    def __int__(self):
        self.no = 0
        self.text = ''

class Menu:
    def __init__(self):
        print('构造函数')
        # (2) 生成菜单数据
        e1 = Entry()
        e1.no = 1
        e1.text = '增加一个学生信息'

        e2 = Entry()
        e2.no = 2
        e2.text = '删除一个学生信息'

        e3 = Entry()
        e3.no = 3
        e3.text = '修改一个学生信息'

        e4 = Entry()
        e4.no = 4
        e4.text = '查询一个学生信息'

        e5 = Entry()
        e5.no = 5
        e5.text = '查询所有学生信息'

        e6 = Entry()
        e6.no = 6
        e6.text = '退出'

        e7 = Entry()
        e7.no = 0
        e7.text = '删除一个学生信息'

        self.e = [] #成员变量
        self.e.append(e1)
        self.e.append(e2)
        self.e.append(e3)
        self.e.append(e4)
        self.e.append(e5)
        self.e.append(e6)
        self.e.append(e7)

    def print_menu(self):
        print('打印菜单')
        # (3) 打印菜单
        print('****菜单开始****')
        for item in self.e:
            print(item.no, item.text)
        print('****菜单结束****')

m = Menu()
m.print_menu()